package com.ck.express.db.dao

import com.ck.express.db.entity.FailedDeliveryRequest
import javax.inject.Inject

class FailedDeliveryRepository @Inject constructor(
    private val dao: FailedDeliveryRequestDao
) {
    // 添加分页参数
    suspend fun getAllFailedRequests(page: Int = 0, size: Int = DEFAULT_PAGE_SIZE): List<FailedDeliveryRequest> {
        return dao.getFailedRequestsByPage(page, size)
    }

    suspend fun updateFailedDelivery(request: FailedDeliveryRequest) {
        dao.update(request)
    }

    companion object {
        private const val DEFAULT_PAGE_SIZE = 20
    }
}